import React from 'react'
import PropTypes from 'prop-types'
import Component, { mapStateToProps, mapDispatchToProps } from '@components/Component'
import { connect } from 'react-redux'
import { message, Modal, Form, Input } from 'antd'
import _ from 'loadsh'
import SecretaryInput from './SecretaryInput'
import BusinessLeaderInput from './BusinessLeaderInput'
import SecretaryGeneralInput from './SecretaryGeneralInput'
import SecretaryHistory from './SecretaryHistory'
import Approve from '@components/ApprovePre/Index'
import BusinessLeaderHistory from './BusinessLeaderHistory'
import SecretaryGeneralHistory from './SecretaryGeneralHistory'
import { caseClosedStatusList, defaultProcedure } from '@js/config'
import { OtherInfo } from '@components/ApprovePre/Approve'
import ArbitratorDetail from './ArbitratorDetail'
const { Item } = Form
const { TextArea } = Input
class FormCourt extends Component {
  state = {
    visible: false,
    restartCallback: null,
    arbitratorVisible: false,
    arbitratorid: ''
  }

  formRef = React.createRef()
  // 设置组庭信息
  setFormCourtData (o) {
    return this.$get('/api/xapc/tribunal', {
      caseid: this.props.caseDetail.id
    }).then(res => {
      if (res.status === 1) {
        const map = {}
        res.data.forEach(li => {
          map[li.id] = li
        })
        o.instances.forEach(instance => {
          instance.formCourt = map[instance.bizid]
        })
        return o
      } else {
        message.warning(res.message)
      }
    })
  }

  // 获取组庭表id
  async createTribunal () {
    const hide = message.loading('新增组庭呈批中', 120)
    const caseid = this.props.caseDetail.id
    const data = await this.getCurrentTribunalRequest(caseid)
    if (data !== null) {
      hide()
      return data.id
    }
    const id = await this.createTribunalRequest(caseid)
    hide()
    return id
  }

  // 获取当前最新的仲裁庭
  async getCurrentTribunalRequest (caseid) {
    const res = await this.$get('/api/xapc/tribunal/getRunningTribunal', {
      caseid
    })
    if (res.status !== 1) {
      throw new Error(res.message)
    }
    return res.data
  }

  // 创建仲裁庭请求
  async createTribunalRequest (caseid) {
    const res = await this.$post('/api/xapc/tribunal', {
      caseid
    })
    if (res.status !== 1) {
      throw new Error(res.message)
    }
    return res.data
  }

  // 获取案件当事人默认仲裁员选择列表
  getCaseDefaultPartyListAndMap () {
    const d = this.props.caseDetail
    const claimants = []
    const claimantsMap = {}
    const respondents = []
    const respondentsMap = {}
    d.applicants.filter(li => li.status).forEach(p => {
      const o = {
        party_name: p.name,
        partyid: p.id,
        arbitrator: '未选定',
        arbitratorid: '',
        arbitrator1: '未选定',
        arbitratorid1: ''
      }
      claimants.push(o)
      claimantsMap[p.id] = o
    })
    d.respondents.filter(li => li.status).forEach(p => {
      const o = {
        party_name: p.name,
        partyid: p.id,
        arbitrator: '未选定',
        arbitratorid: '',
        arbitrator1: '未选定',
        arbitratorid1: ''
      }
      respondents.push(o)
      respondentsMap[p.id] = o
    })
    return { claimants, claimantsMap, respondents, respondentsMap }
  }

  // 获取秘书输入块的初始化数据
  getSecretaryFormInitialData (instance) {
    const { claimants, claimantsMap, respondents, respondentsMap } = this.getCaseDefaultPartyListAndMap()
    const data = { claimants, respondents }
    const court = instance.formCourt
    if (!court) {
      return data
    }
    data.type = court.type
    data.arbitrator_recommend1 = court.arbitrator_recommend1 || '未选定'
    data.arbitratorid_recommend1 = court.arbitratorid_recommend1
    data.arbitrator1_recommend1 = court.arbitrator1_recommend1 || '未选定'
    data.arbitratorid1_recommend1 = court.arbitratorid1_recommend1
    data.arbitrator2_recommend1 = court.arbitrator2_recommend1 || '未选定'
    data.arbitratorid2_recommend1 = court.arbitratorid2_recommend1

    court.tribunal_party.forEach(li => {
      let c = null
      if (li.party_type === '申请人' && claimantsMap[li.partyid]) {
        c = claimantsMap[li.partyid]
      } else if (respondentsMap[li.partyid]) {
        c = respondentsMap[li.partyid]
      }
      if (c) {
        const keys = ['arbitrator', 'arbitratorid', 'arbitrator1', 'arbitratorid1', 'id']
        keys.forEach(key => {
          if (li[key]) {
            c[key] = li[key]
          }
        })
      }
    })
    return data
  }

  // 获取业务处主任表单初始化数据
  getBusinessLeaderFormInitialData (instance) {
    const court = instance.formCourt
    const data = {}
    // 判断当事人选择情况，并将选择情况填充到领导选择框中
    if (court.arbitratorid_claimant === court.arbitratorid_respondent && court.arbitratorid_claimant) {
      data.arbitrator_recommend = court.arbitrator_claimant
      data.arbitratorid_recommend = court.arbitratorid_claimant
    }
    if (court.arbitratorid1_claimant && court.arbitratorid1_claimant !== court.arbitratorid1_respondent) {
      data.arbitrator1_recommend = court.arbitrator1_claimant
      data.arbitratorid1_recommend = court.arbitratorid1_claimant
    }
    if (court.arbitratorid1_respondent && court.arbitratorid1_respondent !== court.arbitratorid1_claimant) {
      data.arbitrator2_recommend = court.arbitrator1_respondent
      data.arbitratorid2_recommend = court.arbitratorid1_respondent
    }
    // 判断领导选择框是否为空，如果为空则将秘书推荐情况填充进来
    if (!data.arbitratorid_recommend && court.arbitratorid_recommend1) {
      data.arbitrator_recommend = court.arbitrator_recommend1
      data.arbitratorid_recommend = court.arbitratorid_recommend1
    }
    if (!data.arbitratorid1_recommend && court.arbitratorid1_recommend1) {
      data.arbitrator1_recommend = court.arbitrator1_recommend1
      data.arbitratorid1_recommend = court.arbitratorid1_recommend1
    }
    if (!data.arbitratorid2_recommend && court.arbitratorid2_recommend1) {
      data.arbitrator2_recommend = court.arbitrator2_recommend1
      data.arbitratorid2_recommend = court.arbitratorid2_recommend1
    }
    return data
  }

  // // 获取秘书长表单初始化数据
  // getSecretaryGeneralFormInitialData (instance) {
  //   const court = instance.formCourt
  //   return {
  //     arbitrator: court.arbitrator_recommend,
  //     arbitratorid: court.arbitratorid_recommend,
  //     arbitrator1: court.arbitrator1_recommend,
  //     arbitratorid1: court.arbitratorid1_recommend,
  //     arbitrator2: court.arbitrator2_recommend,
  //     arbitratorid2: court.arbitratorid2_recommend
  //   }
  // }
  // 获取秘书长表单初始化数据
  getSecretaryGeneralFormInitialData (instance) {
    const court = instance.formCourt
    const data = {}
    // 判断当事人选择情况，并将选择情况填充到领导选择框中
    if (court.arbitratorid_claimant === court.arbitratorid_respondent && court.arbitratorid_claimant) {
      data.arbitrator = court.arbitrator_claimant
      data.arbitratorid = court.arbitratorid_claimant
    }
    if (court.arbitratorid1_claimant && court.arbitratorid1_claimant !== court.arbitratorid1_respondent) {
      data.arbitrator1 = court.arbitrator1_claimant
      data.arbitratorid1 = court.arbitratorid1_claimant
    }
    if (court.arbitratorid1_respondent && court.arbitratorid1_respondent !== court.arbitratorid1_claimant) {
      data.arbitrator2 = court.arbitrator1_respondent
      data.arbitratorid2 = court.arbitratorid1_respondent
    }
    // 判断领导选择框是否为空，如果为空则将秘书推荐情况填充进来
    if (!data.arbitratorid && court.arbitratorid_recommend1) {
      data.arbitrator = court.arbitrator_recommend1
      data.arbitratorid = court.arbitratorid_recommend1
    }
    if (!data.arbitratorid1 && court.arbitratorid1_recommend1) {
      data.arbitrator1 = court.arbitrator1_recommend1
      data.arbitratorid1 = court.arbitratorid1_recommend1
    }
    if (!data.arbitratorid2 && court.arbitratorid2_recommend1) {
      data.arbitrator2 = court.arbitrator2_recommend1
      data.arbitratorid2 = court.arbitratorid2_recommend1
    }
    return data
  }

  // 获取表单初始化数据
  getFormInitialData (instance) {
    switch (instance.currentStep.step_key) {
      case 'zuting01':
        return this.getSecretaryFormInitialData(instance)
      case 'zuting02':
        return this.getBusinessLeaderFormInitialData(instance)
      case 'zuting04':
        return this.getSecretaryGeneralFormInitialData(instance)
      default:
        return {}
    }
  }

  // 更新组庭情况信息
  updateFormCourtData (id, data, oridata) {
    const d = { ...this.state.courtData, ...data }
    delete d.vars
    return this.$put(`/api/xapc/tribunal/${id}`, d)
      .then(res => {
        if (res.status !== 1) {
          throw new Error(res.message)
        }
      })
  }

  // 获取非简易程序当事人选择情况
  getUnsimplePartySelectInfo (vars, data, oridata) {
    const isSamePri = vars.arbitratorid_claimant && vars.arbitratorid_claimant === vars.arbitratorid_respondent // 当事人是否共同选定首席
    const isSameFrist = !!vars.arbitratorid1_claimant && vars.arbitratorid1_claimant !== '未选定' // 申请人是否共同选择第一边裁
    const isSameSecond = !!vars.arbitratorid1_respondent && vars.arbitratorid1_respondent !== '未选定' // 被申请人是否共同选择第二边裁
    const list = []
    oridata.claimants.forEach(li => {
      let str = ''
      const hasPri = !isSamePri && li.arbitratorid
      const hasOther = !isSameFrist && li.arbitratorid1
      if (hasPri && hasOther) {
        str = `申请人${li.party_name}选择${li.arbitrator}为首席仲裁员，并选择${li.arbitrator1}为第一边裁。`
      } else if (hasPri) {
        str = `申请人${li.party_name}选择${li.arbitrator}为首席仲裁员。`
      } else if (hasOther) {
        str = `申请人${li.party_name}选择${li.arbitrator1}为第一边裁。`
      }
      if (str) {
        list.push(str)
      }
    })
    oridata.respondents.forEach(li => {
      let str = ''
      const hasPri = !isSamePri && li.arbitratorid
      const hasOther = !isSameSecond && li.arbitratorid1
      if (hasPri && hasOther) {
        str = `被申请人${li.party_name}选择${li.arbitrator}为首席仲裁员，并选择${li.arbitrator1}为第二边裁。`
      } else if (hasPri) {
        str = `被申请人${li.party_name}选择${li.arbitrator}为首席仲裁员。`
      } else if (hasOther) {
        str = `被申请人${li.party_name}选择${li.arbitrator1}为第二边裁。`
      }
      if (str) {
        list.push(str)
      }
    })
    return list.length ? list.join('\n') : null
  }

  // 获取简易程序
  getSimplePartySelectInfo (vars, data, oridata) {
    const isSamePri = vars.arbitratorid_claimant && vars.arbitratorid_claimant === vars.arbitratorid_respondent // 当事人是否共同选定首席
    if (isSamePri) {
      return null
    }
    if (oridata.claimants.length === 0 && oridata.respondents.length === 0) {
      return null
    }
    const claimants = oridata.claimants.filter(li => li.arbitratorid)
    const respondents = oridata.respondents.filter(li => li.arbitratorid)
    const result = []
    claimants.forEach(li => {
      result.push(`申请人${li.party_name}指定${li.arbitrator}为仲裁员。`)
    })
    respondents.forEach(li => {
      result.push(`申请人${li.party_name}指定${li.arbitrator}为仲裁员。`)
    })
    if (result.length === 0) {
      return null
    }
    return result.join('\n')
  }

  // 秘书提交前数据处理
  async secretaryBeforeSubmit (instance, data, oridata) {
    await this.updateFormCourtData(instance.bizid, data, oridata)
    const vars = oridata.vars || {}
    delete oridata.vars
    const isNormal = this.props.caseDetail.procedure === defaultProcedure
    vars.claimants_arbitrators = JSON.stringify(oridata.claimants)
    vars.respondents_arbitrators = JSON.stringify(oridata.respondents)
    const dataKeys = ['arbitrator_claimant', 'arbitratorid_claimant', 'arbitrator1_claimant', 'arbitratorid1_claimant', 'arbitrator_respondent', 'arbitratorid_respondent', 'arbitrator1_respondent', 'arbitratorid1_respondent']
    const oridataKeys = ['arbitrator_recommend1', 'arbitratorid_recommend1', 'arbitrator1_recommend1', 'arbitratorid1_recommend1', 'arbitrator2_recommend1', 'arbitratorid2_recommend1']
    this.mergeData(vars, data, dataKeys)
    this.mergeData(vars, oridata, oridataKeys)
    vars.party_select_info = isNormal ? this.getUnsimplePartySelectInfo(vars, data, oridata) : this.getSimplePartySelectInfo(vars, data, oridata)
    return {
      remark: oridata.remark,
      vars: vars
    }
  }

  // 获取领导指定仲裁员描述
  getLeaderSelectorDesc (instance, data, oridata) {
    const { formCourt } = instance
    let primarys = new Set()
    let first = new Set()
    let second = new Set()
    formCourt.tribunal_party.forEach(li => {
      if (li.party_type === '申请人') {
        primarys.add(li.arbitratorid)
        first.add(li.arbitratorid1)
      } else if (li.party_type === '被申请人') {
        primarys.add(li.arbitratorid)
        second.add(li.arbitratorid1)
      }
    })
    primarys = [...primarys]
    first = [...first]
    second = [...second]
    const pid = primarys.length === 1 && primarys[0] ? primarys[0] : false
    const fid = first.length === 1 && first[0] ? first[0] : false
    const sid = second.length === 1 && second[0] ? second[0] : false
    const str = []
    if (formCourt.type === '三人庭') {
      if (!pid && oridata.arbitrator_recommend) {
        str.push(`建议指定${oridata.arbitrator_recommend}为首席仲裁员。`)
      }
      if (!fid && oridata.arbitrator1_recommend) {
        str.push(`建议指定${oridata.arbitrator1_recommend}为第一边裁。`)
      }
      if (!sid && oridata.arbitrator2_recommend) {
        str.push(`建议指定${oridata.arbitrator2_recommend}为第二边裁。`)
      }
    } else if (!pid && oridata.arbitrator_recommend) {
      str.push(`建议指定${oridata.arbitrator_recommend}为独任仲裁员。`)
    }
    return str.join('')
  }

  // 业务处领导提交前数据处理
  async businessLeaderBeforeSubmit (instance, data, oridata) {
    await this.updateFormCourtData(instance.bizid, data, oridata)
    const vars = oridata.vars || {}
    delete oridata.vars
    const oridataKeys = ['arbitrator_recommend', 'arbitratorid_recommend', 'arbitrator1_recommend', 'arbitratorid1_recommend', 'arbitrator2_recommend', 'arbitratorid2_recommend']
    this.mergeData(vars, oridata, oridataKeys)
    vars.zuting_biz_leader_select_info = this.getLeaderSelectorDesc(instance, data, oridata)
    return {
      remark: oridata.remark,
      vars: vars
    }
  }

  // 秘书长提交前数据处理
  async secretaryGeneralBeforeSubmit (instance, data, oridata) {
    await this.updateFormCourtData(instance.bizid, data, oridata)
    const vars = oridata.vars || {}
    delete oridata.vars
    const oridataKeys = ['arbitrator', 'arbitratorid', 'arbitrator1', 'arbitratorid1', 'arbitrator2', 'arbitratorid2']
    this.mergeData(vars, oridata, oridataKeys)
    return {
      remark: oridata.remark,
      vars: vars
    }
  }

  // 复制指定的字段到目标对象
  mergeData (to, from, keys) {
    keys.forEach(key => {
      to[key] = from[key]
    })
  }

  // 格式化秘书组庭表单数据
  formatApproveSecretaryData (data) {
    data = _.cloneDeep(data)
    const party = []
    let arbClaimant = ''
    let arbIdClaimant = ''
    let arbClaimant1 = ''
    let arbIdClaimant1 = ''
    let arbRespondent = ''
    let arbIdRespondent = ''
    let arbRespondent1 = ''
    let arbIdRespondent1 = ''
    data.claimants.map((li, i) => {
      li.party_type = '申请人'
      if (i === 0) {
        arbClaimant = li.arbitrator
        arbIdClaimant = li.arbitratorid
        arbClaimant1 = li.arbitrator1
        arbIdClaimant1 = li.arbitratorid1
      } else {
        if (arbClaimant !== '未共同选定' && arbClaimant !== li.arbitrator) {
          arbClaimant = '未共同选定'
          arbIdClaimant = ''
        }
        if (arbClaimant1 !== '未共同选定' && arbClaimant1 !== li.arbitrator1) {
          arbClaimant1 = '未共同选定'
          arbIdClaimant1 = ''
        }
      }
      party.push(li)
    })
    data.respondents.map((li, i) => {
      li.party_type = '被申请人'
      if (i === 0) {
        arbRespondent = li.arbitrator
        arbIdRespondent = li.arbitratorid
        arbRespondent1 = li.arbitrator1
        arbIdRespondent1 = li.arbitratorid1
      } else {
        if (arbRespondent !== '未共同选定' && arbRespondent !== li.arbitrator) {
          arbRespondent = '未共同选定'
          arbIdRespondent = ''
        }
        if (arbRespondent1 !== '未共同选定' && arbRespondent1 !== li.arbitrator1) {
          arbRespondent1 = '未共同选定'
          arbIdRespondent1 = ''
        }
      }
      party.push(li)
    })
    data.tribunal_party = party.map(li => {
      li.assign_datetime = Math.floor(Date.now() / 1000)
      return li
    })
    data.arbitrator_claimant = arbClaimant
    data.arbitratorid_claimant = arbIdClaimant
    data.arbitrator1_claimant = arbClaimant1
    data.arbitratorid1_claimant = arbIdClaimant1
    data.arbitrator_respondent = arbRespondent
    data.arbitratorid_respondent = arbIdRespondent
    data.arbitrator1_respondent = arbRespondent1
    data.arbitratorid1_respondent = arbIdRespondent1
    delete data.claimants
    delete data.respondents
    delete data.remark
    return data
  }

  // 格式化业务处主任数据
  formatApproveBusinessData (data) {
    data = _.cloneDeep(data)
    delete data.remark
    return data
  }

  // 现实仲裁员详情
  showArbitratorDetail (id) {
    this.setState({
      arbitratorid: id,
      arbitratorVisible: true
    })
  }

  // 呈批表单提交前同步组庭数据
  beforeSubmit (instance, data) {
    switch (instance.currentStep.step_key) {
      case 'zuting01':
        return this.secretaryBeforeSubmit(instance, { ...instance.formCourt, ...this.formatApproveSecretaryData(data) }, data)
      case 'zuting02':
        return this.businessLeaderBeforeSubmit(instance, { ...instance.formCourt, ...this.formatApproveBusinessData(data) }, data)
      case 'zuting04':
        return this.secretaryGeneralBeforeSubmit(instance, { ...instance.formCourt, ...this.formatApproveBusinessData(data) }, data)
      default:
        return data
    }
  }

  // 渲染当前操作步骤线上部分
  renderCurrentStepLineTop (formRef, instance, renderFn) {
    switch (instance.currentStep.step_key) {
      case 'zuting01':
        return <SecretaryInput instance={instance} userInfo={this.props.userInfo} caseDetail={this.props.caseDetail} formRef={formRef} />
      case 'zuting02':
        return <BusinessLeaderInput instance={instance} userInfo={this.props.userInfo} caseDetail={this.props.caseDetail} formRef={formRef} />
      case 'zuting04':
        return <SecretaryGeneralInput instance={instance} userInfo={this.props.userInfo} caseDetail={this.props.caseDetail} formRef={formRef} />
      default:
        return renderFn()
    }
  }

  // 渲染历史
  renderHistory (action, renderFn, instance, renderDocument) {
    const key = action.step_key
    const isDisagree = action.opt_add === 'disagree'
    if (key === 'zuting01') {
      return <SecretaryHistory key={action.id} userInfo={this.props.userInfo} instance={instance} action={action} caseDetail={this.props.caseDetail} renderDocument={renderDocument} showArbitratorDetail={(id) => this.showArbitratorDetail(id)} />
    }
    if (key === 'zuting02' && !isDisagree) {
      return <BusinessLeaderHistory key={action.id} userInfo={this.props.userInfo} instance={instance} action={action} caseDetail={this.props.caseDetail} renderDocument={renderDocument} showArbitratorDetail={(id) => this.showArbitratorDetail(id)} />
    }
    if (key === 'zuting04' && !isDisagree) {
      return <SecretaryGeneralHistory key={action.id} userInfo={this.props.userInfo} instance={instance} action={action} caseDetail={this.props.caseDetail} renderDocument={renderDocument} showArbitratorDetail={(id) => this.showArbitratorDetail(id)} />
    }
    return renderFn(action)
  }

  // 重新组庭回调
  multiCreateBeforeHandle (callback) {
    this.setState({
      visible: true,
      restartCallback: callback
    })
  }

  // 取消重新组庭
  cancelRestart () {
    this.setState({
      visible: false,
      restartCallback: null
    })
  }

  // 重新组庭请求
  restartRequest (d) {
    d.caseid = this.props.caseDetail.id
    const hide = message.loading('提交中', 120)
    this.$put('/api/xapc/tribunal/reassign', d)
      .then(res => {
        hide()
        if (res.status === 1) {
          this.state.restartCallback && this.state.restartCallback()
          this.cancelRestart()
        } else {
          message.warning(res.message)
        }
      }).catch(() => hide())
  }

  // 格式化当前数据
  formatCurrentStepData (currentStep, instance) {
    const isFinance = this.props.caseDetail.casetype === '金融案件'
    if (['zuting01', 'zuting02'].indexOf(currentStep.step_key) !== -1 && isFinance) {
      currentStep.actions.map(li => {
        li.level = 1
      })
    }
    return currentStep
  }

  // 渲染呈批其他信息
  renderFlowOtherInfo (instance) {
    const formCourt = instance.formCourt || {}
    const remark = formCourt.reassign_remark
    if (remark) {
      return <OtherInfo title='呈批取消原因' message={remark} />
    }
  }

  render () {
    return (
      <div>
        <Modal
          title='重新组庭'
          open={this.state.visible}
          onOk={() => this.formRef.current.submit()}
          onCancel={() => this.cancelRestart()}
          destroyOnClose
          maskClosable={false}
        >
          <Form ref={this.formRef} onFinish={d => this.restartRequest(d)}>
            <Item name='reassign_remark' label='原因' rules={[{ required: true, message: '理由不能为空' }]}>
              <TextArea rows={3} />
            </Item>
          </Form>
        </Modal>
        <ArbitratorDetail visible={this.state.arbitratorVisible} id={this.state.arbitratorid} hide={() => this.setState({ arbitratorVisible: false })} />
        <Approve
          caseDetail={this.props.caseDetail}
          flowKey='zuting'
          renderCurrentStepLineTop={(...params) => this.renderCurrentStepLineTop(...params)}
          setBizid={() => this.createTribunal()}
          setOtherDataInInstances={data => this.setFormCourtData(data)}
          initialCurrentStepFormData={instance => this.getFormInitialData(instance)}
          beforeSubmit={(...params) => this.beforeSubmit(...params)}
          renderHistory={(h, renderFn, instance, renderDocument) => this.renderHistory(h, renderFn, instance, renderDocument)}
          afterAction={(instance, action) => this.props.refreshCaseData()}
          creatable={this.props.editable}
          multiCreateBeforeHandle={callback => this.multiCreateBeforeHandle(callback)}
          multiCreateButtonText='重新组庭'
          multiply={caseClosedStatusList.indexOf(this.props.caseDetail.status) === -1}
          renderFlowOtherInfo={instance => this.renderFlowOtherInfo(instance)}
          formatCurrentStepData={(currentStep, instance) => this.formatCurrentStepData(currentStep, instance)}
        />
      </div>
    )
  }
}

FormCourt.propTypes = {
  caseDetail: PropTypes.object,
  refreshCaseData: PropTypes.func,
  editable: PropTypes.bool
}
FormCourt.defaultProps = {
  caseDetail: {},
  refreshCaseData: () => {},
  editable: false
}

const mapState = mapStateToProps(function (state) {
  return {
    userInfo: state.basic.userInfo
  }
})

const mapDispatch = mapDispatchToProps(function (dispatch) {
  return {

  }
})

export default connect(mapState, mapDispatch)(FormCourt)
